<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>觉行者 - Java学习挑战平台</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            margin: 0;
            padding: 0;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .container{
            max-width: 500px;
            margin: 20px;
            padding: 40px;
            background: white;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        }
        h1 {
            font-size: 28px;
            text-align: center;
            margin-bottom: 10px;
            color: #333;
        }
        h2 {
            font-size: 16px;
            text-align: center;
            margin-bottom: 30px;
            color: #666;
            font-weight: normal;
            line-height: 1.5;
        }
        .form-group{
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }
        label{
            width: 120px;
            text-align: right;
            margin-right: 15px;
            font-weight: 500;
            color: #555;
        }
        input{
            flex: 1;
            padding: 12px 15px;
            border: 2px solid #e1e1e1;
            border-radius: 8px;
            font-size: 16px;
            transition: all 0.3s;
        }
        input:focus {
            border-color: #007bff;
            outline: none;
            box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
        }
        .button-container {
            display: flex;
            justify-content: center;
            margin-top: 30px;
        }
        button {
            padding: 14px 40px;
            background: linear-gradient(135deg, #007bff, #0056b3);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 4px 15px rgba(0,123,255,0.3);
        }
        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0,123,255,0.4);
        }
        .error-message {
            background: #ffebee;
            color: #c62828;
            padding: 12px;
            border-radius: 6px;
            margin-bottom: 20px;
            border-left: 4px solid #c62828;
        }
    </style>
</head>
<body>
<div class="container">
    <form action="/auth/register" method="post">
        <h1>觉行者</h1>
        <h2>欢迎你来到Java学习挑战平台，请先注册你的账号，开始挑战之旅！</h2>

        <!-- 错误提示 -->
        <div class="error-message" style="display: none;">
            <strong>注册失败：</strong><span id="errorText"></span>
        </div>

        <div class="form-group">
            <label for="username">账号：</label>
            <input type="text" id="username" name="username" placeholder="请输入用户名" required>
        </div>
        <div class="form-group">
            <label for="password">密码：</label>
            <input type="password" id="password" name="password" placeholder="请输入密码" required>
        </div>
        <div class="form-group">
            <label for="confirmPassword">确认密码：</label>
            <input type="password" id="confirmPassword" name="confirmPassword" placeholder="请再次输入密码" required>
        </div>
        <div class="button-container">
            <button type="submit">开始挑战之旅</button>
        </div>
    </form>
</div>

<script>
  // 音频播放函数
  function playVoiceAudio(type) {
    const audioMap = {
      'register': '/sounds/funny/注册页面注册一个专属账号成为觉行者大家庭的一员开启你的学习冒险之旅吧.wav'
    };
    
    const audioPath = audioMap[type];
    if (!audioPath) return;
    
    const audio = new Audio(audioPath);
    audio.play().catch(err => {
      console.error('播放音频失败:', err);
    });
  }
  
  // 页面加载完成后播放欢迎音效
  document.addEventListener('DOMContentLoaded', () => {
    setTimeout(() => {
      playVoiceAudio('register');
    }, 500);
  });
</script>
</body>
</html>